<template>
	<view  >
		<u-card :title="question.questionPeople" :sub-title="subTitle" :thumb="thumb" v-for="question in questions">
			<view class="" slot="body">
				<view class="u-body-item u-flex u-border-bottom u-col-between u-p-t-0">
					<view class="u-body-item-title u-line-2">{{question.description}}</view>
					<image
						:src="question.images[0].imageUrl" mode="aspectFill"></image>
				</view>

			</view>
			<view class="" slot="foot" @click="pageToAnswer(question.id)">
				<u-icon name="chat-fill" size="34" color="" :label=question.id></u-icon>
				<u-button type="primary" @click="pageToAnswer(question.id)">回答问题</u-button>
	
			
			</view>
		
		</u-card>
		
	</view>
</template>

<script>
	export default {
		data() {
			return {
				questions: [],			
				title: '素胚勾勒出青花，笔锋浓转淡',
				subTitle: '2020-05-15',
				thumb: '',
			};
		},
		methods: {
			pageToAnswer(id){
				console.log(id);
				 uni.navigateTo({
				 	url: "/pages/life/answer?id="+id
				 })
			}

		},
		created() {
			this.$axios.get("/api/life/question/getAll").then(r => {
				this.questions = r.data.data;
				console.log(this.questions);
				console.log(this.questions[2].images[0].imageUrl)
			})
		}
	};
</script>

<style scoped lang="scss">
	.u-card-wrap {
		background-color: $u-bg-color;
		padding: 1px;
	}

	.u-body-item {
		font-size: 32rpx;
		color: #333;
		padding: 20rpx 10rpx;
	}

	.u-body-item image {
		width: 120rpx;
		flex: 0 0 120rpx;
		height: 120rpx;
		border-radius: 8rpx;
		margin-left: 12rpx;
	}
</style>
